#!/bin/bash

# This bash script is used to start a browser on a Linux client
# system

# Only arguement is the input URL
URL=$1

#
# First browser choice to launch on a Linux platform is
# 'opera', followed by 'mozilla', followed by 'netscape'.
#
# We could query installed RPM packages for the specific
# browser, but the client may have it network accessible
# instead.  Just look to see if there is a $PATH to the
# corresponding product executable.
#
which opera > /dev/null 2>&1
if [ $? -eq 0 ]; then
    if [ -f /opt/hsc/bin/hmcBrowserLaunch ] ; then
       hmcBrowserLaunch $URL &
    else
       opera $URL &
    fi
else
    which mozilla > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        mozilla $URL &
    else
        which netscape > /dev/null 2>&1
        if [ $? -eq 0 ]; then
            netscape $URL &
        else
            exit 1
        fi
    fi
fi

exit 0
